# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-jsonschema-spec
pkgver=0.2.3
pkgrel=1
pkgdesc="JSONSchema Spec with object-oriented paths"
url="https://github.com/p1c2u/jsonschema-spec"
license=('Apache')
arch=('any')
depends=('python-pathable' 'python-yaml' 'python-requests' 'python-referencing')
makedepends=('python-build' 'python-installer' 'python-poetry-core')
checkdepends=('python-pytest' 'python-responses')
source=("https://github.com/p1c2u/jsonschema-spec/archive/$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('6de68cfa9aeda77cb68ad0d15cb87dd6298bf178424ea40e3009d78a9a5a5ee66443560a0d99521d02e2fbfcecbd081b24d1dd7dee216eaea1fffbd8f7a71e8a')

prepare() {
  cd jsonschema-spec-$pkgver
  sed -i '/--cov/d' pyproject.toml
}

build() {
  cd jsonschema-spec-$pkgver
  python -m build -wn
}

check() {
  cd jsonschema-spec-$pkgver
  PYTHONPATH="$PWD" pytest
}

package() {
  cd jsonschema-spec-$pkgver
  python -m installer -d "$pkgdir" dist/*.whl
}
